<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:36:"./views/home/mobile/auth/login.phtml";i:1625674082;}*/ ?>
<html lang="en" style="font-size: 53.3333px;"><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录</title>
    <link rel="stylesheet" type="text/css" href="/static/home/mobile/css/login.css">
        <script type="text/javascript" src="/static/home/mobile/js/jquery.min.js"></script>
        <!-- 弹出层 -->
        <link rel="stylesheet" href="/static/plugins/dialog/css/dialog.css" />
        <link rel="stylesheet" href="/static/home/mobile/css/aui.css" />
        <script src="/static/plugins/dialog/lib/zepto.min.js"></script>
        <script src="/static/plugins/dialog/js/dialog.js"></script>
        <!-- 弹出层 -->
        <script type="text/javascript" src="/static/home/mobile/js/global.js"></script>
        
        
    <script src="/static/home/mobile/js/jsbridge-mini.js"></script>


        
<style>
  body,html{background:#0f0f0f;}
  .bg{
    background:#0f0f0f;
    height:260px;
    background-image:url(/static/home/mobile/images/login-bg.png);
    background-position:top center;
    background-size:cover;
    background-repeat:no-repeat;
  }
  .main-title{text-align:center;margin-top:70px;font-size:22px;color:#fff;}
  .box-title{text-align:center;margin-top:20px;font-size:28px;color:#fff;}
  .main_box{position:absolute;top:220px;left:10px;right:10px;border-radius:20px;background:#222222;}
  .con_bg{padding:20px;}
  .con_bg input{border:none;vertical-align: middle;margin-top:15px;background:#222222;color:#fff;}
  .con_bg >span{width:100%;display:inline-block; border-bottom:1px solid #444;padding-left:20px;background-position:left center !important;background-repeat:no-repeat !important;background-size:18px !important;
    padding-bottom:0px !important;
  }
  .con_bg .first_sp{background:url(/static/home/mobile/images/icon-username.png);}
  .con_bg .second_sp{background:url(/static/home/mobile/images/icon-pwd.png);}
  .con_bg .thrid_sp{background:url(/static/home/mobile/images/icon-code.png);}

  .con_bg .thrid_sp{display: flex;align-items:center;}
  .con_bg .thrid_sp input{width:70%;}
  .con_bg .thrid_sp #getcode{margin-left:auto;color:#0062CC;font-size:16px;line-height:30px;}
  .log_btn{display:block;background:linear-gradient(to right,#295AFF,#4BAFF9);width:90%;padding:10px 20px;text-align:center;margin:auto;border-radius:30px;color:#fff;}
  .forget_btn{text-align:center;display:block;margin:30px auto 10px;}
  .bottom{display:block;margin-bottom:20px;text-align:center;}
  .bottom img{width:50px !important;display:inline-block;}
  
  .read{text-align:center;width:100%;}
  .read > span{color:#999;padding:5px;font-size:13px;padding-left:20px;
    background:url(/static/home/mobile/images/icon-sel.png);background-position:left center;background-size:16px;background-repeat:no-repeat;display:inline-block;
    margin-top:2px;
  }
  .read.active  > span{background:url(/static/home/mobile/images/icon-sel-active.png);background-position:left center;background-size:16px;background-repeat:no-repeat;display:inline-block;}
  a{display:inline-block}
</style>
</head>

<body style="background:#000">
    <div class="main_login">
    <div class="bg">
        <header class="aui-bar aui-bar-nav" id="aui-header" style="background: none;">
	        <a class="aui-btn aui-pull-left" tapmod href="javascript:history.back();">
	            <span class="aui-iconfont aui-icon-left" style="color:#FFF"></span>
	        </a>
	        <div id="title" class="aui-title aui-hide"></div>
	        <a class="aui-btn aui-pull-right" tapmode href="/home/auth/register.html">
               <span class="aui-iconfont aui-icon-gear" style="color:#FFF;font-size:14px;">注册</span>
            </a>
	    </header>
	    <div class="main-title"></div>
    </div>
    <div class="main_box">
        <div class="box-title">Hi~</div>
        <form id="login_form">
            <div class="con_bg">
                <span class="first_sp"><input id="username" name="username" type="text" minlength="11" maxlength="11" placeholder="请输入手机号"/></span>
                <span class="second_sp"><input id="password" name="password" type="password" placeholder="请输入密码"></span>
                <!--<span class="thrid_sp"><input id="code" type="number" maxlength="6" placeholder="请输入验证码"/><span id="getcode" tapmode onclick="getCode();">获取验证码</span></span> -->
            </div>
        </form>
        <a  href="javascript:void(0);" class="log_btn js-login">登录</a>
        <a  tapmode href="/home/auth/findpwd.html" class="forget_btn">忘记密码？</a>
        <div style="text-align:center">
          <a class="read " tapmode onclick="readClick(this);" style="display:inline-block;width:auto;"><span>已阅读并同意</span></a><font style="color:#4BAFF9;font-size:13px;" tapmode onclick="fnOpenYingsi(event)">隐私条款和隐私政策</font>
        </div>
		<div class="bottom" id="display-block-Is_Quick_login" >
			<img tapmode onclick="startWxLogin()" style="width:60px;margin:30px auto;display: block;" src="" alt="微信" class="pic2"/>
		</div>
    </div>
</div>

        <script type="text/javascript">
            $(function () {
                //确认登陆
                $('.js-login').click(function () {
                    if(!isread){
                       message("请勾选阅读并同意！",'',"error");
        		      return;
        	     	}
                    $.post(
                        window.location.href,
                        $('#login_form').serialize(),
                        function(res) {
                            $('.yzm img').click();
                            //alert(res.message+"==="+res.redirect+"==="+res.type)
                            message(res.message,res.redirect,res.type);
                        },'json'
                    );
                });

                //回车登录
                $(document).keyup(function(event){
                    if(event.keyCode ==13){
                        $('.js-login').click();
                    }
                });
                
                
            $('body').show();
            
            if (jsBridge.inApp) {
            	$('body').show();
			} else {    
			  //  alert("请在App内打开程序");
			//    location.href='/'
			    //alert("不在App中");
			}
			
                
                
            });
            

        var isread = false;
		function readClick(e){
		    $(e).toggleClass("active")
		    isread = !isread;
		}
		
		function fnOpenYingsi(event){
        	//event.stopPropagation();
            //event.preventDefault();
		    window.location.href="/home/auth/userprotocol?xapp-target=blank";
		}


        </script>
        <script>
        	  function wxLogin(){
                jsBridge.wxLogin(function(succ, obj) {
                    if (succ) {
                        $.post(
                              '/index.php/home/auth/wxLogin',
                              {
                                openid:obj.openid,
                                nickname:obj.userinfo.nickname,
                                headimgurl:obj.userinfo.headimgurl,
                              },
                            function (ret) {
                                message(ret.message,ret.redirect,ret.type);
                            },'json'
                        );
                        //alert(JSON.stringify(obj));
                    }
                });
			}
			
		   function startWxLogin(){
		       if(typeof(api) == "undefined"){
		           // wxLogin();
		           message("请到APP打开！",'',"error");
		       }else{
		           WX_login();
		       }
		   }
			//微信调用登陆
		function WX_login() {
		   var wx = api.require('wx');
			wx.auth(function(ret, err) {
			    alert(JSON.stringify(ret))
				if(ret.status) {
					WX_auth(ret.code)
				} else {
					api.toast({
						msg: '微信授权失败！请稍后重试！',
						duration: 5000,
					    location : 'middle' 
					});
				}
			});
		}

		function WX_auth(code) {
			var auth_code = code;
			wx.getToken({
				apiKey: '',
				apiSecret: '', 
				code: auth_code
			}, function(ret, err) {
				if(ret.status) {
					Other_type = '微信';
					localStorage.setItem('Other_accessToken', ret.accessToken); // openid ：用户openid
					var openId = ret.openId;
					var accessToken = ret.accessToken;
					WX_getUserInfo(openId, accessToken);
				} else {
					api.toast({
						msg: '微信快捷登陆配置错误',
						duration: 5000,
					    location : 'middle' 
					});
				}
			});
		}
		//获取微信信息
		function WX_getUserInfo(Other_openid, Other_accessToken) {
			var accessToken = Other_accessToken;
			var openId = Other_openid;
			wx.getUserInfo({
				accessToken: accessToken,
				openId: openId
			}, function(ret, err) {
				if(ret.status) {
					//alert(JSON.stringify(ret));
					localStorage.setItem('Other_name', ret.nickname); // nickname  ：用户昵称
					localStorage.setItem('Other_img', ret.headimgurl); // figureurl_qq_2   ：用户大头像（100）地址
					localStorage.setItem('Other_openid', openId); // openid ：用户openid
					$.post(
                          '/index.php/home/auth/wxLogin',
                          {
                            openid:openId,
                            nickname:ret.nickname,
                            headimgurl: ret.headimgurl,
                          },
                        function (ret) {
                            message(ret.message,ret.redirect,ret.type);
                        },'json'
                    );
				// 	api.ajax({
				// 		url: api_url+'/login/login/is_wechat_register.html',
				// 		method: 'get',
				// 		data: {
				// 			values: {
				// 				key: 'ikmovie.xyz',   //安全码
				// 				username: localStorage.getItem('Other_openid')
				// 			}
				// 		}
				// 	}, function(ret, err) {
				// 		if(ret) {
				// 				if(ret.cun == 1) { //当前用户已存在
				// 					denglu();    // 直接登录
				// 				}else{
				// 					Other_Reg();   //     不存在就注册
				// 				}

				// 			}else{
				// 			//获取失败 网络错误
				// 					api.toast({
				// 						msg: '网络连接异常',
				// 						duration: 5000,
				// 					location : 'middle' 
				// 					});	


				// 			}

				// 		});
					
					
				} else {
						api.toast({
							msg: '微信授权信息获取失败',
							duration: 5000,
						location : 'middle' 
						});	

				}
			});
		}

			
        </script>

</body></html>